<?php
/**
 * Created by PhpStorm.
 * User: wangyufei
 * Date: 2019/6/20
 * Time: 5:22 PM
 */

namespace App\Model;


use Illuminate\Support\Facades\DB;

class DBTables
{
    public function listDB($db,$floor)
    {
        $data['list'] = DB::table("$db")
            ->where('ad_floor',$floor)
            ->orderby('ad_id','desc')
            ->paginate(15);
        return $data;
    }

    public function infoDB($db,$id)
    {
        $data['info'] = DB::table("$db")
            ->where('ad_id',$id)
            ->first();
        return $data;
    }
}